package com.ss.student.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ss.student.dao.StudentDao;
import com.ss.student.pojo.StudentInfo;
/**
 * 学生管理
 * @author Administrator
 *
 */
@Repository
public class StudentDaoImpl extends SqlMapClientDaoSupport implements StudentDao {

	@Override
	public void addStu(StudentInfo info) throws Exception {
		// TODO Auto-generated method stub
		this.getSqlMapClientTemplate().insert("stu.addStu",info);
	}

	@Override
	public List<StudentInfo> queryStu(StudentInfo info) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().queryForList("stu.queryStu",info);
	}

	@Override
	public int delStu(String id) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().delete("stu.delStu",id);
	}

	@Override
	public int updateStu(StudentInfo info) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().update("stu.updateStu",info);
	}

	@Override
	public StudentInfo getOneStu(StudentInfo info) throws Exception {
		// TODO Auto-generated method stub
		return (StudentInfo)this.getSqlMapClientTemplate().queryForObject("stu.getOneStu",info);
	}

}
